use actix_web::{HttpResponse};
use crate::{
    common::{Response, Pool},
    apps::backend::models::Withdraw as Model,
};

pub struct Withdraws;

impl Withdraws {

    /// 银行列表
    pub async fn index(db: Pool) -> HttpResponse {
        match Model::list(&db).await {
            Ok(v) => {
                Response::encrypt_data(&v)
            },
            Err(message) => {
                Response::error(&message.to_string())
            }
        }
    }
}